Optimal. Leaf size=67 \[ -\frac{4 c^2 \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)}-\frac{4 c^2 \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)^2}+\frac{c^2 x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.228489, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 6, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {3903, 3777, 3919, 3794, 3796, 3797} \[ -\frac{4 c^2 \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)}-\frac{4 c^2 \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)^2}+\frac{c^2 x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3903
Rule 3777
Rule 3919
Rule 3794
Rule 3796
Rule 3797
Rubi steps
\begin{align*} \int \frac{(c-c \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx &=\frac{\int \left (\frac{c^2}{(1+\sec (e+f x))^2}-\frac{2 c^2 \sec (e+f x)}{(1+\sec (e+f x))^2}+\frac{c^2 \sec ^2(e+f x)}{(1+\sec (e+f x))^2}\right ) \, dx}{a^2}\\ &=\frac{c^2 \int \frac{1}{(1+\sec (e+f x))^2} \, dx}{a^2}+\frac{c^2 \int \frac{\sec ^2(e+f x)}{(1+\sec (e+f x))^2} \, dx}{a^2}-\frac{\left (2 c^2\right ) \int \frac{\sec (e+f x)}{(1+\sec (e+f x))^2} \, dx}{a^2}\\ &=-\frac{4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac{c^2 \int \frac{-3+\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}\\ &=\frac{c^2 x}{a^2}-\frac{4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac{\left (4 c^2\right ) \int \frac{\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}\\ &=\frac{c^2 x}{a^2}-\frac{4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac{4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}\\ \end{align*}
Mathematica [A] time = 0.0521523, size = 67, normalized size = 1. \[ \frac{c^2 \left (\frac{2 \tan ^3\left (\frac{e}{2}+\frac{f x}{2}\right )}{3 f}+\frac{2 \tan ^{-1}\left (\tan \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{f}-\frac{2 \tan \left (\frac{e}{2}+\frac{f x}{2}\right )}{f}\right )}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.08, size = 65, normalized size = 1. \begin{align*}{\frac{2\,{c}^{2}}{3\,f{a}^{2}} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{3}}-2\,{\frac{{c}^{2}\tan \left ( 1/2\,fx+e/2 \right ) }{f{a}^{2}}}+2\,{\frac{{c}^{2}\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) }{f{a}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.55873, size = 230, normalized size = 3.43 \begin{align*} -\frac{c^{2}{\left (\frac{\frac{9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac{\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac{12 \, \arctan \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} - \frac{c^{2}{\left (\frac{3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac{\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}} + \frac{2 \, c^{2}{\left (\frac{3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac{\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.04437, size = 225, normalized size = 3.36 \begin{align*} \frac{3 \, c^{2} f x \cos \left (f x + e\right )^{2} + 6 \, c^{2} f x \cos \left (f x + e\right ) + 3 \, c^{2} f x - 4 \,{\left (2 \, c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sin \left (f x + e\right )}{3 \,{\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{c^{2} \left (\int - \frac{2 \sec{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec{\left (e + f x \right )} + 1}\, dx + \int \frac{\sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec{\left (e + f x \right )} + 1}\, dx + \int \frac{1}{\sec ^{2}{\left (e + f x \right )} + 2 \sec{\left (e + f x \right )} + 1}\, dx\right )}{a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.23605, size = 85, normalized size = 1.27 \begin{align*} \frac{\frac{3 \,{\left (f x + e\right )} c^{2}}{a^{2}} + \frac{2 \,{\left (a^{4} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 3 \, a^{4} c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )\right )}}{a^{6}}}{3 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]